﻿<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:pv="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView"
             x:Class="KursachApp.MainPage"
             Title="Страница пользователей">

    <StackLayout>

        <pv:PancakeView BackgroundColor="LightGray" CornerRadius="15" Padding="10">
            <Entry Placeholder="Поиск..." TextChanged="OnSearchTextChanged" BackgroundColor="LightGray" TextColor="Black" PlaceholderColor="Gray"/>
        </pv:PancakeView>
        <!--<SearchBar x:Name="searchBar" Placeholder="Поиск" SearchCommand="{Binding SearchCommand}" BackgroundColor="LightGray" TextColor="Black" 
               PlaceholderColor="Gray" CancelButtonColor="DarkGray"/>-->
        
        <ListView x:Name="friendsList" ItemsSource="{Binding}" ItemSelected="OnItemSelected" RowHeight="80">
            <ListView.ItemTemplate >
                <DataTemplate >
                    <ViewCell >
                        <ViewCell.View >
                            
                            <Frame CornerRadius="10"  
                                BorderColor="DarkSeaGreen"
                                
                                HasShadow="True"
                                
                                IsClippedToBounds="True">
                                
                                <StackLayout Orientation="Vertical" Spacing="1"  >
    
                                <StackLayout Orientation="Horizontal">
                                    <Label Text="{Binding SurName}" FontSize="Medium"  />
                                    <Label Text="{Binding Name}" FontSize="Medium" />
                                    <Label Text="{Binding Patronymic}" FontSize="Medium" />
                                    </StackLayout>
                                    <StackLayout Orientation="Horizontal">
                                        <Label Text="{Binding Role}" FontSize="Small"   />
                                        <Label Text="   ID = " FontSize="Small"   />
                                        <Label Text="{Binding Id}" FontSize="Small"   />
                                    </StackLayout>
                                </StackLayout>
                            </Frame>

                        </ViewCell.View>
                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
        </ListView>
        <Button Text="Добавить" Clicked="CreateFriend" VerticalOptions="End"/>
    </StackLayout>

</ContentPage>
